/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ejb.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author ADMIN
 */
@Entity
@Table(catalog = "EASYTICKETS", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "Event.findAll", query = "SELECT e FROM Event e"),
    @NamedQuery(name = "Event.findByEventId", query = "SELECT e FROM Event e WHERE e.eventId = :eventId"),
    @NamedQuery(name = "Event.findByTitle", query = "SELECT e FROM Event e WHERE e.title = :title"),
    @NamedQuery(name = "Event.findByProduction", query = "SELECT e FROM Event e WHERE e.production = :production"),
    @NamedQuery(name = "Event.findByArtist", query = "SELECT e FROM Event e WHERE e.artist = :artist"),
    @NamedQuery(name = "Event.findByStartDate", query = "SELECT e FROM Event e WHERE e.startDate = :startDate"),
    @NamedQuery(name = "Event.findByEndDate", query = "SELECT e FROM Event e WHERE e.endDate = :endDate"),
    @NamedQuery(name = "Event.findByTimeShow", query = "SELECT e FROM Event e WHERE e.timeShow = :timeShow"),
    @NamedQuery(name = "Event.findByTicketQuantity", query = "SELECT e FROM Event e WHERE e.ticketQuantity = :ticketQuantity"),
    @NamedQuery(name = "Event.findByImages", query = "SELECT e FROM Event e WHERE e.images = :images"),
    @NamedQuery(name = "Event.findByContent", query = "SELECT e FROM Event e WHERE e.content = :content"),
    @NamedQuery(name = "Event.findByTicketPrice", query = "SELECT e FROM Event e WHERE e.ticketPrice = :ticketPrice"),
    @NamedQuery(name = "Event.findByStatus", query = "SELECT e FROM Event e WHERE e.status = :status")})
public class Event implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(nullable = false)
    private Integer eventId;
    @Size(max = 50)
    @Column(length = 50)
    private String title;
    @Size(max = 50)
    @Column(length = 50)
    private String production;
    @Size(max = 50)
    @Column(length = 50)
    private String artist;
    @Temporal(TemporalType.TIMESTAMP)
    private Date startDate;
    @Temporal(TemporalType.TIMESTAMP)
    private Date endDate;
    @Temporal(TemporalType.TIMESTAMP)
    private Date timeShow;
    private Integer ticketQuantity;
    @Size(max = 50)
    @Column(length = 50)
    private String images;
    @Size(max = 1073741823)
    @Column(length = 1073741823)
    private String content;
    private Integer ticketPrice;
    private Boolean status;
    @OneToMany(mappedBy = "eventId")
    private List<Venue> venueList;
    @JoinColumn(name = "EventType", referencedColumnName = "EventTypeId")
    @ManyToOne
    private EventType eventType;
    @OneToMany(mappedBy = "eventId")
    private List<TicketBook> ticketBookList;

    public Event() {
    }

    public Event(Integer eventId) {
        this.eventId = eventId;
    }

    public Integer getEventId() {
        return eventId;
    }

    public void setEventId(Integer eventId) {
        this.eventId = eventId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getProduction() {
        return production;
    }

    public void setProduction(String production) {
        this.production = production;
    }

    public String getArtist() {
        return artist;
    }

    public void setArtist(String artist) {
        this.artist = artist;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public Date getTimeShow() {
        return timeShow;
    }

    public void setTimeShow(Date timeShow) {
        this.timeShow = timeShow;
    }

    public Integer getTicketQuantity() {
        return ticketQuantity;
    }

    public void setTicketQuantity(Integer ticketQuantity) {
        this.ticketQuantity = ticketQuantity;
    }

    public String getImages() {
        return images;
    }

    public void setImages(String images) {
        this.images = images;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Integer getTicketPrice() {
        return ticketPrice;
    }

    public void setTicketPrice(Integer ticketPrice) {
        this.ticketPrice = ticketPrice;
    }

    public Boolean getStatus() {
        return status;
    }

    public void setStatus(Boolean status) {
        this.status = status;
    }

    public List<Venue> getVenueList() {
        return venueList;
    }

    public void setVenueList(List<Venue> venueList) {
        this.venueList = venueList;
    }

    public EventType getEventType() {
        return eventType;
    }

    public void setEventType(EventType eventType) {
        this.eventType = eventType;
    }

    public List<TicketBook> getTicketBookList() {
        return ticketBookList;
    }

    public void setTicketBookList(List<TicketBook> ticketBookList) {
        this.ticketBookList = ticketBookList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (eventId != null ? eventId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Event)) {
            return false;
        }
        Event other = (Event) object;
        if ((this.eventId == null && other.eventId != null) || (this.eventId != null && !this.eventId.equals(other.eventId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ejb.entity.Event[ eventId=" + eventId + " ]";
    }
    
}
